package cn.humaohua.study.yanmo_design_pattern.ch13.v2;

public class SubstractCommand implements Command {
    private OperationApi operation;
    private double opeNum;

    public SubstractCommand(OperationApi operation, double opeNum) {
        this.operation = operation;
        this.opeNum = opeNum;
    }

    @Override
    public void execute() {
        this.operation.substract(opeNum);
    }

    @Override
    public void undo() {
        this.operation.add(opeNum);
    }

}
